package practice08;

import java.util.Scanner;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice08
 * @ClassName: TestVisitor
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/1 17:13
 * @Copyright 大牛版板所有
 */
public class TestVisitor {
    public static void main(String[] args) {
        Visitor vis = new Visitor();
        Scanner input = new Scanner(System.in);
        String isExit;
        do {
            System.out.print("请输入用户名：");
            vis.name = input.next();
            System.out.print("请输入年龄：");
            vis.age = input.nextInt();
            double price = vis.buy();
            System.out.println(vis.name+"的年龄为："+vis.age+"，门票"+(price==0?"免费":"价格为："+price));
            System.out.print("\n请输入是否继续购票（Y/N）：");
            isExit = input.next();
        }while (!"N".equalsIgnoreCase(isExit));
        System.out.println("退出程序");
    }
}
